package com.quanquan.store.repository;

import com.quanquan.store.entity.BannerAdsence;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @ClassName:BannerAdsenseRepository
 * @Description:TODO
 * @Author:xiongjunbao
 * @Date:2019/3/14 9:18
 * @Version 1.0
 */
public interface BannerAdsenceRepository extends JpaRepository<BannerAdsence, String> {

    @Query(value = "SELECT * FROM oo_banner_adsence WHERE adsense_id = ?1 AND status_remove = 0 AND status_show = 0", nativeQuery = true)
    List<BannerAdsence> queryByAdsenceId(String adsenceId);

    @Query(value = "SELECT * FROM oo_banner_adsence WHERE banner_id = ?1 AND status_remove = 0 AND status_show = 0", nativeQuery = true)
    List<BannerAdsence> queryByBannerId(String bannerId);

}
